FROM golang:1.18 AS builder
ENV GOPROXY=https://goproxy.cn
WORKDIR /httpserver
COPY main.go  ./main.go
COPY go.mod ./go.mod
RUN  \
  go mod tidy && \
  go build  -o ./main
FROM busybox
COPY --from=builder /httpserver/main ./main
EXPOSE 80
ENTRYPOINT ["./main"]